package org.jaaksi.customviewdemo.roundview

import android.content.Context
import android.util.AttributeSet
import android.widget.LinearLayout

class DJRoundLinearLayout @JvmOverloads constructor(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0
) : LinearLayout(
    context, attrs, defStyleAttr
), IRoundViewDelegate {
    private val delegate = RoundViewDelegate(this, attrs)

    override fun getRoundDelegate() = delegate

    override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
        super.onLayout(changed, left, top, right, bottom)
        delegate.checkAndSetBackground()
    }
}